﻿using System;
using EasyDapr.Domain;
using InventoryService.Domain.Event;

namespace InventoryService.Domain.Model
{
    public class Inventory : EntityBase<string>, IAggregateRoot
    {
        /// <summary>
        /// ID
        /// </summary>
        public override string Id { get; set; } = Guid.NewGuid().ToString("N");
        public string Location { get; set; }
        public string Website { get; set; }
        public string Description { get; set; }

        public Inventory()
        {
        }

        public Inventory(string location, string website, string description)
        {
            Location = location;
            Website = website;
            Description = description;

            // 添加领域事件
            AddDomainEvent(new InventoryCreatedEvent(location, website, description));
        }
    }
}